<template>
  <div class="cart-complete-wrap">
    <div class="cart-complete">
      <img src="https://c1.mifile.cn/f/i/17/static/success.png" />
      <h3>已成功加入购物车！</h3>
      <div class="goods">
        <div class="left-good">
          <div class="right-info">
            <p class="title">{{ goodsInfo.name }}</p>
            <p
              class="attr"
              v-for="(attrs, index) in goodsInfo.attrs"
              :key="index"
            >
              {{ attrs }}
            </p>
          </div>
        </div>
        <div class="right-gocart">
          <router-link to="/detail" class="sui-btn btn-xlarge"
            >返回上一级</router-link
          >
          <router-link to="/detail" class="setcolor">去购物车结算 </router-link>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "AddCartSuccess",
  data() {
    return {
      goodsInfo: JSON.parse(sessionStorage.getItem("goodsInfo")),
    };
  },
};
</script>

<style lang="less" scoped>
.cart-complete-wrap {
  background-color: #f4f4f4;
  padding-top: 20px;

  .cart-complete {
    width: 1200px;
    margin: 0 auto;

    img{
      margin-top: 20px;
      margin-left: -15px;
    }

    h3 {
      font-weight: 400;
      font-size: 24px;
      color: rgb(66, 66, 66);
      padding-top: 15px;
      padding-bottom: 15px;
      margin-right: 915px;
      margin-top: 8px;
      float: right;
    }

    .goods {
      overflow: hidden;
      padding: 10px 0;
      margin-left: 60px;

      .left-good {
        float: left;

        .left-pic {
          border: 1px solid #dfdfdf;
          width: 60px;
          float: left;
          img {
            width: 60px;
            height: 60px;
          }
        }

        .right-info {
          color: #444;
          float: left;
          margin-left: 10px;
          margin-top: -18px;

          .title {
            width: 100%;
            line-height: 28px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 14px;
          }

          .attr {
            color: #aaa;
          }
        }
      }

      .right-gocart {
        float: right;
        .btn-xlarge{
          margin-right: 15px;
        }
        .setcolor{
          background-color: rgb(255,103,0);
          color: #fff;
        }
        a {
          padding: 7px 36px;
          font-size: 15px;
          line-height: 22px;
          color: #333;
          background-color: #eee;
          text-decoration: none;
          box-sizing: border-box;
          border: 1px solid #e1e1e1;
        }

        .btn-xlarge:hover {
          background-color: #f7f7f7;
          border: 1px solid #eaeaea;
        }

        a:active {
          background-color: #e1e1e1;
          border: 1px solid #d5d5d5;
        }

        .btn-danger {
          background-color: #e1251b;
          color: #fff;
        }

        .btn-danger:hover {
          background-color: #e1251b;
        }
      }
    }
  }
}
</style>
